#coding=utf-8
from numpy import arange
from sympy import *
import matplotlib.pyplot as plt

x = Symbol('x')

l = 83.326*(1-exp(-0.571*(x-0.567)))
dl = diff(l, x)
ddl = diff(dl,x)
print dl
print ddl
print 

y = 8*(1-exp(-0.571*(x-0.567)))**3.3456
dy = diff(y, x)
ddy = diff(dy,x)
print dy
print ddy
print


t0 = [i for i in range(1,15)]
t = arange(1, 15, 0.1)
s = [y.subs(x,i).evalf() for i in t0]
s2 = [dy.subs(x,i).evalf() for i in t]
s3 = [ddy.subs(x,i).evalf() for i in t]
s4 = [0 for i in range(18)]
s5 = [l.subs(x,i).evalf() for i in t0]
print s
print s5
plt.plot(t0,s, '.')
plt.plot(t,s2)
plt.plot(t,s3, 'r')
plt.plot(s4)
plt.show()

print '--------------'
s3 = [ddy.subs(x,i).evalf() for i in t2]
for i in t2:
  print i
print '--------------'
for i in s3:
  print i
